<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>删除属性&节点</title>
</head>
<body>
<div id="container" >

    <div id="other" style="" name="" class="" title="">
        杂项
    </div>
</div>
<button type="button" onclick="removeAttr()">点击移除属性</button>
<script type="text/javascript">
    function removeAttr(){
        let div = document.querySelector("#other");
        console.table(div);
        // 直接调用方法，更常见
        div.removeAttribute("class");
        div.attributes.removeNamedItem("style") ;
        console.log(div.attributes);
    }
</script>
</body>
</html>